/*
  Copyright 2007 Anders Båtstrand

      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.

 */

package org.dyndns.anderlin.jmplayer.client.ui;

import org.dyndns.anderlin.jmplayer.service.ArtistService;
import org.springframework.binding.form.FormModel;
import org.springframework.richclient.form.AbstractForm;
import org.springframework.richclient.form.builder.GridBagLayoutFormBuilder;

import javax.swing.*;

/**
 * Piece form
 */
public class PieceForm extends AbstractForm {

    public static final String GENERAL_FORM_PAGE = "generalPage";

    private ArtistService artistService;

    public PieceForm(ArtistService artistService, FormModel formModel) {
        super(formModel, GENERAL_FORM_PAGE);
        this.artistService = artistService;
    }

    protected JComponent createFormControl() {
        GridBagLayoutFormBuilder formBuilder = new GridBagLayoutFormBuilder(getBindingFactory());
        formBuilder.appendLabeledField("title");
        formBuilder.nextLine();
        formBuilder.appendLabeledField("parent");
        formBuilder.nextLine();
        formBuilder.appendLabeledField("composer");
        formBuilder.nextLine();
        formBuilder.appendLabeledField("published");
        formBuilder.nextLine();
        formBuilder.appendLabeledField("arrangementOf");
        return formBuilder.getPanel();
    }


    public boolean requestFocusInWindow() {
        return false;
    }
}

